DefaultVideoPlayerState

open class DefaultVideoPlayerState(audioMode: AudioMode = AudioMode(), cacheConfig: CacheConfig = CacheConfig()) : VideoPlayerState

Constructors

Link copied to clipboard
constructor(audioMode: AudioMode = AudioMode(), cacheConfig: CacheConfig = CacheConfig())

Properties

Link copied to clipboard
open override val aspectRatio: Float
Link copied to clipboard
open override val availableSubtitleTracks: MutableList<SubtitleTrack>
Link copied to clipboard
open override var currentSubtitleTrack: SubtitleTrack?
Link copied to clipboard
open override val currentTime: Double
Link copied to clipboard
open override val duration: Double

Returns the total duration of the media in seconds.

Link copied to clipboard
open override val durationText: String

Returns the total duration of the video as a formatted string.

Link copied to clipboard
open override val error: VideoPlayerError?
Link copied to clipboard
open override val hasMedia: Boolean
Link copied to clipboard
open override var isFullscreen: Boolean
Link copied to clipboard
open override val isLoading: Boolean
Link copied to clipboard
open override var isPipActive: ERROR CLASS: Unresolved name: getValue
Link copied to clipboard
open override var isPipEnabled: Boolean
Link copied to clipboard
open override val isPipSupported: Boolean
Link copied to clipboard
open override val isPlaying: Boolean

Indicates whether the video is currently playing.

Link copied to clipboard
open override var loop: Boolean

Specifies if the video should loop when it reaches the end.

Link copied to clipboard
open override val metadata: VideoMetadata
Link copied to clipboard
open override var onPlaybackEnded: () -> Unit?

Callback invoked when playback reaches the end of the media. Only called when loop is false. May be invoked from a background thread.

Link copied to clipboard
open override var onRestart: () -> Unit?

Callback invoked when playback restarts from the beginning due to looping. Only called when loop is true. May be invoked from a background thread.

Link copied to clipboard
open override var playbackSpeed: Float
Link copied to clipboard
var player: ERROR CLASS: Symbol not found for AVPlayer??
Link copied to clipboard
var playerLayer: ERROR CLASS: Symbol not found for AVPlayerLayer??
Link copied to clipboard
open override val positionText: String

Returns the current playback position as a formatted string.

Link copied to clipboard
open override var sliderPos: Float

Represents the current playback position as a value between 0.0 and 1000.0.

Link copied to clipboard
open override var subtitleBackgroundColor: ERROR CLASS: Symbol not found for Color
Link copied to clipboard
open override var subtitlesEnabled: Boolean
Link copied to clipboard
open override var subtitleTextStyle: ERROR CLASS: Symbol not found for TextStyle
Link copied to clipboard
open override var userDragging: Boolean

Denotes whether the user is manually adjusting the playback position.

Link copied to clipboard
val videoAspectRatio: ERROR CLASS: Symbol not found for CGFloat
Link copied to clipboard
open override var volume: Float

Controls the playback volume. Valid values are within the range of 0.0 (muted) to 1.0 (maximum volume).

Functions

Link copied to clipboard
open override fun clearCache()

Clears the shared video cache, removing all cached media data from disk.

Link copied to clipboard
open override fun clearError()
Link copied to clipboard
open override fun disableSubtitles()

Disables subtitle display.

Link copied to clipboard
open override fun dispose()

Releases all resources used by the video player (native players, coroutines, observers, etc.).

Link copied to clipboard
open suspend override fun enterPip(): PipResult
Link copied to clipboard
open override fun openAsset(fileName: String, initializeplayerState: InitialPlayerState = InitialPlayerState.PLAY)

Opens a media file bundled with the application.

Link copied to clipboard
open override fun openFile(file: ERROR CLASS: Symbol not found for PlatformFile, initializeplayerState: InitialPlayerState)
abstract fun openFile(file: io/github/vinceglb/filekit/PlatformFile, initializeplayerState: InitialPlayerState = InitialPlayerState.PLAY)
Link copied to clipboard
open override fun openUri(uri: String, initializeplayerState: InitialPlayerState = InitialPlayerState.PLAY)

Opens a media source from the given URI.

Link copied to clipboard
open override fun pause()

Pauses video playback.

Link copied to clipboard
open override fun play()

Starts or resumes video playback.

Link copied to clipboard
open override fun restart()

Restarts playback from the beginning. Works reliably from any state, including when playback has ended.

Link copied to clipboard
open fun seekFinished()

Commits the seek after a user-driven seek interaction. Performs the actual seek on the player and ends the dragging state.

Link copied to clipboard
open fun seekStart(value: Float)

Begins a user-driven seek interaction (e.g. slider drag). Updates the visual slider position without performing the actual seek on the player. Must be followed by seekFinished to commit the seek.

Link copied to clipboard
open override fun seekTo(value: Float)

Seeks to a specific playback position. The value should be between 0.0 and 1000.0.

Link copied to clipboard
open override fun selectSubtitleTrack(track: SubtitleTrack?)

Selects a subtitle track for display. If track is null, disables subtitles.

Link copied to clipboard
open override fun stop()

Stops playback and resets the player state.

Link copied to clipboard
open override fun toggleFullscreen()

Toggles the fullscreen state of the video player